/// <reference path="../types.ts" />
/// <reference path="../helpers.ts" />
/// <reference path="organization.ts" />

module $Xrm.Messages {
    export class AssociateEntitiesRequest extends OrganizationRequest {
        public Moniker1: EntityReference = null;
        public Moniker2: EntityReference = null;
        public RelationshipName: string = null;

        constructor() {
            super("AssociateEntities", "b"); // namespace is 'b' because this request is from crm4 days
        }

        GetResponse(responseXml: Document): AssociateEntitiesResponse {
            return new AssociateEntitiesResponse(responseXml);
        }

        ToSoapXml(): string {
            this.Parameters["Moniker1"] = this.Moniker1;
            this.Parameters["Moniker2"] = this.Moniker2;
            this.Parameters["RelationshipName"] = this.RelationshipName;

            return super.ToSoapXml();
        }
    }

    export class AssociateEntitiesResponse extends OrganizationResponse {
        constructor(responseXml?: Document) {
            super("AssociateEntities", responseXml);
        }
    }
}